-
Notifications
You must be signed in to change notification settings - Fork 1.2k
test: set default delay to 0.05s for wait_until in functional tests #6631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…waiting votes to be propagated be9cf82 test: fix intermittent failure in feature_governance.py waiting votes to be propagated (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented While implementing #6631 found instability in feature_governance.py ## What was done? Governance votes are not delivered instantly between notes. If any vote is delayed a bit the wrong amount of votes will be remembered and test will fail further when comparing its count. ## How Has This Been Tested? Tested locally with changes from #6631 without them - 90+% probability feature_governance.py to fail, with them - no failure happens locally. ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone ACKs for top commit: UdjinM6: utACK be9cf82 Tree-SHA512: 113f22314c1a269bfe804e8ad3f1aa02dd31155af08f073345bce52d93d23746cee543814f5b44791698e40eca843a747660fddf2a4eafb235c3b3044fe06ba6
fd6ce4f
to
1017a12
Compare
WalkthroughThe changes adjust the polling intervals in wait loops within the test framework and related functional tests. The default sleep interval in the core 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
b0dea8c test: extra logs for wait-for-CL and wait-for-IS (Konstantin Akimov) 49ae952 fix: intermittent error in feature_notification.py due to missing quorum for CL (Konstantin Akimov) 538687b fix: intermittent error in p2p_instantsend.py due to missing quorum for CL (Konstantin Akimov) 834d2f6 test: fix intermittert error in feature_asset_locks.py due to missing IS quorum (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented In functional test `feature_asset_locks.py` a quorum for InstantSend is not generated intentionally but usually it is enough time to be formed while other quorums are generated. Similar situation for `p2p_instantsend.py` and `feature_notifications.py`. This fix is one of the blockers for #6631 because with smaller delays extra quorums (beyond expected) almost never formed. Example of logs: 2025-05-15T19:50:51.884000Z TestFramework (INFO): Test no IS for asset unlock... 2025-05-15T19:50:52.892000Z TestFramework (INFO): Send tx with expected_error:'None'... 2025-05-15T19:51:54.214000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: '''' def check_instantlock(): self.bump_mocktime(1) try: return node.getrawtransaction(txid, True)["instantlock"] except: return False .... not true after 60.0 seconds Meanwhile, there's just no quorum for signing InstantSend, logs from nodes: node3 2025-05-15T19:50:54.054321Z (mocktime: 2014-12-04T18:19:47Z) [ scheduler] [llmq/signing.cpp:712] [AsyncSignIfMember] [llmq] CSigningManager::AsyncSignIfMember -- failed to select quorum. id=ce79d1f19020ec65caa8a81306362ddad6ffd0e6fc45e18c83630f401b38d54c, msgHash=83b6e8b1549ad9f2750e13e61aabdf08fd31eb1e80cbbd3729920c4c840318ae ## What was done? ## How Has This Been Tested? Run functional tests ## Breaking Changes N/A ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK b0dea8c PastaPastaPasta: utACK b0dea8c Tree-SHA512: e4455f859d83a7933e7dd48b0214199d98e6242f03817c64ac351bef39422a713f332540ea0fffed92785b346541a6cafdece5488b9665805384c9033a5a9cb9
Have you seen any additional flakeyness? Especially in stuff like tsan? |
Quorums are already generated and mined, all calculations are done. Waiting long (0.5seconds) is not necessary Bumping mocktime and generation new blocks no useful anymore
Same delay is used for Bitcoin Core. Though, it can be appliable directly for each usages such as quorum generation or waiting for IS lock. It happends because some functional tests not only waiting during delay, but also does something strange such as bumping mocktime or generating new blocks. Also, some works during quorum generation are assuming to be done while we waiting, but it's not properly validated after delay, just assumed as it is done.
I haven't noticed any extra flackiness. This PR has small scope, mostly affect p2p tests: not all delays reduced to 0.05 but just some. on CI (github) tsan job experienced 2 tests to fail on the first attempt:
on CI (gitlab) tsan job 4 experienced 4 tests to be re-attempted:
I did force-push on top of develop to see CI run one more time. Though, further improvement causes flackines and partially addressed by #6673, #6672, #6671 |
Issue being fixed or feature implemented
Waiting for 0.5s in functional test for every action is a bit excessive, especially for p2p tests that sending messages by localnetwork and waiting at least 0.5 seconds before checking if message is received.
What was done?
Decreasing default delay from 0.5s to 0.05s. It affects mostly p2p tests, but many other tests become faster too.
For quorum formation; for sporks and some other dash specific features bigger delays (0.5s, 1s) are used.
Further improvements are blocked by #6673, #6672, #6671 and are out of scope this PR.
How Has This Been Tested?
Speed up on CI for 30% and more.
[develop] linux64-test https://gitlab.com/dashpay/dash/-/jobs/10049432489
ALL | ✓ Passed | 7241 s (accumulated)
Runtime: 1272 s
[PR] linux64-test https://gitlab.com/dashpay/dash/-/jobs/10067158169
ALL | ✓ Passed | 5421 s (accumulated)
Runtime: 938 s
-25%
[develop] linux64-nowallet https://gitlab.com/dashpay/dash/-/jobs/10049432511
ALL | ✓ Passed | 2739 s (accumulated)
Runtime: 488 s
[PR] linux64-nowallet https://gitlab.com/dashpay/dash/-/jobs/10067158174
ALL | ✓ Passed | 1232 s (accumulated)
Runtime: 243 s
-49%
[develop] linux64-tsan https://gitlab.com/dashpay/dash/-/jobs/10049432499
ALL | ✓ Passed | 10399 s (accumulated)
Runtime: 2023 s
[PR] linux64-tsan https://gitlab.com/dashpay/dash/-/jobs/10072993489
ALL | ✓ Passed | 8710 s (accumulated)
Runtime: 1543 s
-25%
[develop] Functional tests on localhost (-O3, debug, no sanitizers, -j20):
ALL | ✓ Passed | 6680 s (accumulated)
Runtime: 372 s
[PR] Functional tests on localhost (-O3, debug, no sanitizers, -j20):
ALL | ✓ Passed | 4609 s (accumulated)
Runtime: 365 s
Benefits of running locally in 20 parallel jobs are very slight. Accumulated time is decreased for 32% as expected, but total time is improved less than 2%.
It is because the slowest tests requires many quorums to be formed and they are still slow.
Breaking Changes
N/A
Checklist: